﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="show2.aspx.cs" Inherits="ShareMarking.ShowqrCode.show" %>


<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>美赞臣</title>
    <link href="css/style.css" rel="stylesheet"/>
    <script src="js/adaptive.js"></script>
    <style>
        dt{width:160px;}
    </style>
</head>
<body>
<form id="form1" runat="server">
    <div class="wrap">
        <div class="content-border">
            <div class="code-border">
                <img src="" id="img_qrcode" class="code-img" width="100%" alt="二维码"/>
            </div>
            <dl>
                <dt>员工姓名 : </dt>
                <dd id="name"></dd>
            </dl>
            <dl>
                <dt>员工工号 : </dt>
                <dd id="nccode"></dd>
            </dl>
            <dl>
                <dt>员工手机 : </dt>
                <dd id="mobile"></dd>
            </dl>
            <dl>
                <dt>NCL姓名 : </dt>
                <dd id="nclname"></dd>
            </dl>
            <dl>
                <dt>NCL工号 : </dt>
                <dd id="nclcode"></dd>
            </dl>
            <dl>
                <dt>NCL手机 : </dt>
                <dd id="nclmobile"></dd>
            </dl>
            <%--<dl>
                <dt>门店编号 : </dt>
                <dd id="shopcode"></dd>
            </dl>
            <dl>
                <dt>门店名称 : </dt>
                <dd id="shopname"></dd>
            </dl>--%>
            
            <div style='text-align:center;margin-bottom:15px;'>NC门店列表</div>

            <div id="divshop" >
            </div>

        </div>
    </div>

    <%--<div class="body-border">
        <div class="hint-border">
            <p>工号不正确，请重新输入</p>
        </div>
        <div class="btm-border">
            <input class="btn-input" id="btn_submit" type="button" value="返回"/>
        </div>
    </div>--%>

</form>
<script src="js/jquery.min.js" type="text/javascript"></script>
<script>

    // 获取地址栏的参数数组

    function getUrlParams() {

        var search = window.location.search;

        // 写入数据字典

        var tmparray = search.substr(1, search.length).split("&");

        var paramsArray = new Array;

        if (tmparray != null) {

            for (var i = 0; i < tmparray.length; i++) {

                var reg = /[=|^==]/;    // 用=进行拆分，但不包括==

                var set1 = tmparray[i].replace(reg, '&');

                var tmpStr2 = set1.split('&');

                var array = new Array;

                array[tmpStr2[0]] = tmpStr2[1];

                paramsArray.push(array);

            }

        }

        // 将参数数组进行返回

        return paramsArray;

    }

    // 根据参数名称获取参数值

    function getParamValue(name) {

        var paramsArray = getUrlParams();

        if (paramsArray != null) {

            for (var i = 0; i < paramsArray.length; i++) {

                for (var j in paramsArray[i]) {

                    if (j == name) {

                        return paramsArray[i][j];

                    }

                }

            }

        }

        return null;

    }


    function GetUrlParam(paramName) {

        var url = document.URL; //URL参数，你也可以用document.URL来获取，方法太多了

        var oRegex = new RegExp('[\?&]' + paramName + '=([^&]+)', 'i');

        //var oMatch = oRegex.exec( window.top.location.search ) ; //获取当前窗口的URL

        var oMatch = oRegex.exec(url);

        if (oMatch && oMatch.length > 1)

            return oMatch[1]; //返回值

        else

            return '';

    }

    //获取url参数

    function GetUrlParms(name) {

        var reg = new RegExp("(^|\\?|&)" + name + "=([^&]*)(\\s|&|$)", "i");

        if (reg.test(location.href))

            return unescape(RegExp.$2.replace(/\+/g, " "));

        return "";

    }

    var getQuery = function (i) {

        var j = location.search.match(new RegExp("[?&]" + i + "=([^&]*)(&?)", "i"));

        return j ? j[1] : j

    };

</script>
<script>

    $("#nccode").html(GetQueryString('nccode'));
    //    var shopcode = $("#shopcode").html(GetQueryString('shop_code'));
    //    var shopname = $("#shopname").html(decodeURI(getParamValue("shop_name")));
    var shopcode = decodeURI(GetQueryString('shop_code')).split(',');
    var shopname = decodeURI(getParamValue("shop_name")).split('，');
    var str = "";
    for (var i = 0; i < shopcode.length; i++) {
        str = str + '<a style="display:block;padding-top:-22px;">' + shopname[i] + '(' + shopcode[i] + ')' + '</a></br>';
        divshop.innerHTML = str;
    }

    $.ajax({
        type: "post",
        url: "api.ashx?method=getnc",
        dataType: "json",
        data: { nccode: GetQueryString('nccode') },
        success: function (result) {
            if (result.status == 0) {
                $("#name").html(result.name);
                $("#img_qrcode").attr('src', result.code_url);
                $("#mobile").html(result.mobile);
                $("#nclname").html(result.nclname);
                $("#nclcode").html(result.nclcode);
                $("#nclmobile").html(result.nclmobile);
            }
        }
    })

function GetQueryString(name)
{
     var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
     var r = window.location.search.substr(1).match(reg);
     if(r!=null)return  unescape(r[2]); return null;
}
</script>




</body>
</html>